package com.lu.component.crypto.config;

import com.lu.component.crypto.interceptor.DecryptInterceptor;
import com.lu.component.crypto.interceptor.EncryptInterceptor;
import org.apache.ibatis.plugin.Interceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 描述
 *
 * @author: zhanglu
 * @date: 2023/9/21 21:51
 * @modify: 修改人信息, 修改内容 2023/9/21 21:51
 */
@Configuration
public class MybatisConfig {

    @Bean
    @ConditionalOnClass(Interceptor.class)
    public EncryptInterceptor encryptInterceptor() {
        return new EncryptInterceptor();
    }

    @Bean
    @ConditionalOnClass(Interceptor.class)
    public DecryptInterceptor decryptInterceptor() {
        return new DecryptInterceptor();
    }

}
